<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
    //    function getMax(a,b){
    //       return a>b?a:b;
    //    }
    //   let i= getMax(2,3)
    //   document.write(i)
        function getArrMax(arr=[]){
             let max = arr[0]
             let min=arr[0]
             for(let i=1;i<arr.length;i++){
                 if(arr[i]<min){
                     min=arr[i]
                 }
                 if(arr[i]>max){
                     max=arr[i]
                 }
             }
            
            return [max,min]

        }
        let i= getArrMax([2, 5, 8, 10, 1])
        document.write(i)
    </script>
</body>
</html>